import request from '@/config/axios'

export interface DeviceArchivesVO {
  id: number
  deviceCode: string
  deviceName: string
  dictDeviceType: number
  deptId: number
  deptName: string
  dictDeviceStatus: number
  remark: string
}

export interface keyName {
  id: number
  name:string
}

// 查询配置中心--设备信息--设备档案列表
export const getDeviceArchivesPage = async (params) => {
  return await request.get({ url: `/config/device-archives/page`, params })
}

// 查询配置中心--设备信息--设备档案详情
export const getDeviceArchives = async (id: number) => {
  return await request.get({ url: `/config/device-archives/get?id=` + id })
}

// 新增配置中心--设备信息--设备档案
export const createDeviceArchives = async (data: DeviceArchivesVO) => {
  return await request.post({ url: `/config/device-archives/create`, data })
}

// 修改配置中心--设备信息--设备档案
export const updateDeviceArchives = async (data: DeviceArchivesVO) => {
  return await request.put({ url: `/config/device-archives/update`, data })
}

// 删除配置中心--设备信息--设备档案
export const deleteDeviceArchives = async (id: number) => {
  return await request.delete({ url: `/config/device-archives/delete?id=` + id })
}

// 导出配置中心--设备信息--设备档案 Excel
export const exportDeviceArchives = async (params) => {
  return await request.download({ url: `/config/device-archives/export-excel`, params })
}

// 负责人
export const exportDevicehead = async (keyword: string) => {
  return await request.get({ url: `/config/org-staff-archives/list-all-simple?keyword=` + keyword })
}